home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / cstdio.arc / SRC.ARC / MSSTAT.C < prev    next >
C/C++ Source or Header  |  1984-08-01  |  614b  |  25 lines

  1. /*    msstat.c - get MS-DOS file status.
  2.     (C) Copyright 1984 Gregory R. Mansfield - All Rights Reserved.
  3.     G. R. Mansfield.  84/07/25.
  4.     Ver 1.0-4801.
  5. */
  6.  
  7. #include <defstd.h>
  8. #include <msstat.h>
  9.  
  10. int msstat(name, buf)
  11. char *name;    /* string containing path name */
  12. struct msstat *buf;    /* buffer to receive information */
  13. {
  14.     BYTE *p, mbuf[45];
  15.     int i;
  16.  
  17.     if (msfmf(name, SA_AM, mbuf) == ERR)    /* find matching file */
  18.         return(ERR);
  19.     for (p = buf, i = 21; i < 44; i++)    /* copy to stat buf */
  20.         *p++ = mbuf[i];
  21.     if (msfnf() != ERR)    /* error if file name is not unique */
  22.         return(ERR);
  23.     return(0);
  24. }
  25.